﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using TraditionalMalteseCuisine.App_Code.Functions;
using TraditionalMalteseCuisine.App_Code.Objects;
using TraditionalMalteseCuisine.App_Code.Operations;

namespace TraditionalMalteseCuisine
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {
            ConnectionOp.DatabasePath = Request.MapPath("App_Data\\TraditionalMalteseCuisine.accdb");

            if ((Request.Cookies["TraditionalMalteseCuisine_MemberID"] != null) && (Request.Cookies["TraditionalMalteseCuisine_MemberID"].Value.Length > 0) && (Validation_Functions.IsNumeric(Request.Cookies["TraditionalMalteseCuisine_MemberID"].Value)))
                MainMasterPage.MemberID = int.Parse(Request.Cookies["TraditionalMalteseCuisine_MemberID"].Value);
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}